import {request} from "@/network/request";

//获取当前用户的信息
export function getUserInfoByMySelf(){
    return request({
        url: '/admin/user',
        method: 'get'
    })
}
//获取用户所有信息 //搜索用户数据
export function getAllUserInfoAndRole(current,size,type,data){
    return request({
        url: '/admin/user/list',
        method: 'get',
        params:{current,size,type,data}
    })
}
//修改用户的角色信息
export function updateRoleByUserId(roleList,userId){
    return request({
        url: '/admin/user/role/update/'+userId,
        method:'post',
        data:roleList,
    })
}
//修改用户信息
export function updateUser(userIfo){
    return request({
        url: '/admin/user/update',
        method: 'post',
        data:userIfo,
    })
}
//添加用户信息
export function addUser(userInfo){
    return request({
        url: '/admin/user/add',
        method:'post',
        data:userInfo
    })
}
//批量禁用 批量启用
export function bachStatueUser(userIds,statue){
    return request({
        url: '/admin/user/bachStatue/'+statue,
        method: 'post',
        data:userIds,
    })
}
//批量重置用户密码
export function bachRestPassword(userIds){
    return request({
        url: '/admin/user/bachRestPassword',
        method: 'post',
        data:userIds,
    })
}
//用户头像
export function userImageAdd(file){
    return request({
        url: '/minio/user/uploadImage',
        method:'post',
        data:file,
    })
}

//重置密码
export function updatePasswordByUserId(data){
    return request({
        url: '/admin/user/updatePassword',
        method: 'post',
        data:data
    })
}
//用户修改自己的信息
export function updateUserByMySelf(userInfo){
    return request({
        url: '/admin/user/updateMySelf',
        method: 'post',
        data:userInfo,
    })
}